package com.wzy.web.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * PmProject entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "pm_project", catalog = "saozhe")
public class PmProject implements java.io.Serializable {

	// Fields

	private Integer projectId;
	private String projectName;
	private String projectDetail;
	private String dateTime;
	private Set<PmLeader> pmLeaders = new HashSet<PmLeader>(0);
	private Set<PmDeledate> pmDeledates = new HashSet<PmDeledate>(0);
	private Set<PmProcess> pmProcesses = new HashSet<PmProcess>(0);
	private Set<PmAffix> pmAffix = new HashSet<PmAffix>(0);
	private Set<PmArticle> pmArticle = new HashSet<PmArticle>(0);
	// Constructors

	/** default constructor */
	public PmProject() {
	}

	/** minimal constructor */
	public PmProject(String projectName, String projectDetail, String dateTime) {
		this.projectName = projectName;
		this.projectDetail = projectDetail;
		this.dateTime = dateTime;
	}

	/** full constructor */
	public PmProject(String projectName, String projectDetail, String dateTime,
			Set<PmLeader> pmLeaders, Set<PmDeledate> pmDeledates,Set<PmProcess> pmProcesses,Set<PmAffix> pmAffix,Set<PmArticle> pmArticle) {
		this.projectName = projectName;
		this.projectDetail = projectDetail;
		this.dateTime = dateTime;
		this.pmLeaders = pmLeaders;
		this.pmDeledates = pmDeledates;
		this.pmProcesses = pmProcesses;
		this.pmAffix = pmAffix;
		this.pmArticle = pmArticle;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "projectId", unique = true, nullable = false)
	public Integer getProjectId() {
		return this.projectId;
	}

	public void setProjectId(Integer projectId) {
		this.projectId = projectId;
	}

	@Column(name = "projectName", nullable = false, length = 100)
	public String getProjectName() {
		return this.projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	@Column(name = "projectDetail", nullable = true, length = 65535)
	public String getProjectDetail() {
		return this.projectDetail;
	}

	public void setProjectDetail(String projectDetail) {
		this.projectDetail = projectDetail;
	}

	@Column(name = "dateTime", nullable = false, length = 20)
	public String getDateTime() {
		return this.dateTime;
	}

	public void setDateTime(String dateTime) {
		this.dateTime = dateTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "pmProject")
	public Set<PmLeader> getPmLeaders() {
		return this.pmLeaders;
	}

	public void setPmLeaders(Set<PmLeader> pmLeaders) {
		this.pmLeaders = pmLeaders;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "pmProject")
	public Set<PmDeledate> getPmDeledates() {
		return this.pmDeledates;
	}

	public void setPmDeledates(Set<PmDeledate> pmDeledates) {
		this.pmDeledates = pmDeledates;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "pmProject")
	public Set<PmProcess> getPmProcesses() {
		return pmProcesses;
	}

	public void setPmProcesses(Set<PmProcess> pmProcesses) {
		this.pmProcesses = pmProcesses;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "pmProject")
	public Set<PmAffix> getPmAffix() {
		return pmAffix;
	}

	public void setPmAffix(Set<PmAffix> pmAffix) {
		this.pmAffix = pmAffix;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "pmProject")
	public Set<PmArticle> getPmArticle() {
		return pmArticle;
	}

	public void setPmArticle(Set<PmArticle> pmArticle) {
		this.pmArticle = pmArticle;
	}
	
}